package com.jxs.android.util;

import android.content.Context;
import android.content.Intent;
import android.provider.MediaStore;

import com.jxs.android.ges.GesApplication;

public class StartHelper {

	public static Intent getIntent(Class<?> actyClass) {
		Intent intent = new Intent(GesApplication.getApplication(), actyClass);
		return intent;
	}

	public static void startActivity(Class<?> actyClass) {
		Context context = GesApplication.getApplication();
		Intent intent = new Intent(context, actyClass);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		context.startActivity(intent);
	}

	public static void startService(Class<?> actyClass) {
		Context context = GesApplication.getApplication();
		Intent intent = new Intent(context, actyClass);
		context.startService(intent);
	}

	public static void startActivity(Intent intent) {
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		GesApplication.getApplication().startActivity(intent);
	}

	public static Intent getTakePhotoIntent() {
		Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
		intent.putExtra("return-data", true);
		return Intent.createChooser(intent, "拍照");
	}

	public static Intent getPhotoPickIntent() {
		Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
		intent.setType("image/*"); // 过滤档案格式
		Intent destIntent = Intent.createChooser(intent, "请选择图片");
		return destIntent;
	}
}
